package com.leetroll.media.controller;

import com.leetroll.media.job.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;


@RestController
@RequestMapping("/job")
@Slf4j
public class JobController {

    private final Job_Temp jobService;
    private final Job_Poliigon jobPoliigon;
    private final Job_Doc jobDoc;
    private final Job_ConceptArt jobConceptArt;
    private final Job_BMS jobBMS;
    private final Job_Metric jobMetric;
    private final Job_Clean jobClean;
    private final Job_Evermotion jobEvermotion;
    private final Job_Sound01 soundJob01;
    private final Job_Image jobImage;
    private final Job_Bluezone jobBluezone;
    private final Job_Gumroad_VFX jobGumroadVfx;

    @Autowired
    public JobController(Job_Temp jobService, Job_Poliigon jobPoliigon, Job_Doc jobDoc, Job_ConceptArt jobConceptArt, Job_BMS jobBMS, Job_Metric jobMetric, Job_Clean jobClean, Job_Evermotion jobEvermotion, Job_Sound01 soundJob01, Job_Image jobImage, Job_Bluezone jobBluezone, Job_Gumroad_VFX jobGumroadVfx) {
        this.jobService = jobService;
        this.jobPoliigon = jobPoliigon;
        this.jobDoc = jobDoc;
        this.jobConceptArt = jobConceptArt;
        this.jobBMS = jobBMS;
        this.jobMetric = jobMetric;
        this.jobClean = jobClean;
        this.jobEvermotion = jobEvermotion;
        this.soundJob01 = soundJob01;
        this.jobImage = jobImage;
        this.jobBluezone = jobBluezone;
        this.jobGumroadVfx = jobGumroadVfx;
    }

    @GetMapping("/rename-file")
    public void aliyun() {
//        jobService.renameFiles();
    }

    @GetMapping("/poliigon")
    public void poliigon() throws IOException, InterruptedException {
//        poliigonJob.generateMetrics();
//        poliigonJob.uploadTextures();
    }

    @GetMapping("/doc")
    public void doc() throws IOException, InterruptedException {
//        docJob.upload();
    }

    @GetMapping("/art")
    public void art() throws Exception {
//        conceptArtJob.upload();
    }

    @GetMapping("/bms")
    public void bms() throws Exception {
//        bmsJob.upload();
    }

    @GetMapping("/metric")
    public void metric() throws Exception {
//        metricJob.generateMetrics();
    }

    @GetMapping("/clean")
    public void clean() throws Exception {
        jobClean.deleteItem();
    }

    @GetMapping("/run")
    public void run() throws Exception {
        jobGumroadVfx.upload();
    }

    @GetMapping("/sound")
    public void soundJob01() throws Exception {
//        soundJob01.upload();
        jobBluezone.upload();
    }

    @GetMapping("/image")
    public void imageJob() throws Exception {
        jobImage.upload();
    }

}
